<script setup>
const props = defineProps({
  title: {
    type: String,
    default: 'Form Title'
  },
});
</script>

<template>
<div style="display: flex; flex-direction: column;">
  <div class="form-box">
    <div class="form-header">
      <div class="form-header-title">{{ props.title }}</div>
    </div>
    <div class="form-content">
      <slot></slot>
    </div>
  </div>
</div>
</template>

<style scoped lang="less">
.form-box{
  display: flex;
  flex-direction: column;
  border: 1px solid #e4e4e4;
  padding: 10px;
  flex: 1;

  .form-header {
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    margin-top: -23px;
    padding: 0 10px;

    .form-header-title {
      padding: 0 10px;
      background-color: white;
      display: inline-block;
      font-size: 16px;
      color: #333;
    }
  }
  .form-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
}
</style>
